home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3283 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.0 KB

  1. Path: news-feed.mci.newscorp.com!usenet
  2. From: pbe@pobox.com
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: C++ with Zapp vs. Delphi
  5. Date: 23 Jan 1996 02:47:14 GMT
  6. Organization: Phoenix Business Enterprises
  7. Message-ID: <4e1i7i$v29@klein.delphi.com>
  8. References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu> <30fe666e.3349285@130.15.126.54> <4dmjt8$6sv@crc-news.doc.ca> <30ff9519.1799465@130.15.126.54> <4doe07$4u8@crc-news.doc.ca>
  9. NNTP-Posting-Host: 206.15.161.89
  10. X-To: Slobodan Celenkovic <slobodan@cs.unh.edu>
  11. X-Mailer: SQUID
  12. X-Registration: $737961
  13.  
  14. >>No, you end up with the same number of classes.  *You* need to write a
  15. >>separate class for each item to be put into the list.  *I* need to
  16. >>write a separate class for each kind of list.  I don't need to put
  17. >>sorting information into items; sorting is what the list does.
  18. >
  19. >Sorting algorithm is still in the list class (binary search, quick sort,
  20. >. .). However the item comparison shouldn't go into the list class, but
  21. >item classes. Why? Because items "know" how to compare themselves to
  22. >other items. Once again see Booch.
  23.  
  24.      Yes, and this can be done with Delphi (TSTRINGS TSTRINGS TSTRINGS
  25. TSTRINGS)  The SORT method would be in the list, IT would use COMPARE, but
  26. since compare would be OVERRIDEN, the List's Sort would use the Item's
  27. compare.
  28.  
  29.      Ie, You write SORT once! just define Compare as an abstract so you know
  30. it's IMPLEMENTATION.
  31.  
  32. >Yes, but whenever the item classes change you must go back and change the 
  33. >list class. This is exactly what should be avoided. So if you got the 
  34.  
  35.      No. Only create a new descendent.
  36.  
  37. >list class from a vendor in a library you should be able to create new 
  38. >item classes and store them in the list without making any changes to the 
  39. >list class. This is ideally what we'd want (at least I would). Once you 
  40.  
  41.      As you can do in Delphi.
  42.  
  43. >implement the list you shouldn't have to go back and change it. So the 
  44. >sort method should sort an abstract item class without having to know 
  45. >details of item comparison. Again because items change the list must be 
  46. >insulated from item internals, including the comparison code.
  47.  
  48.      YES YES YES! Delphi CAN do this!
  49.  
  50. >2) OO way using MI (#1)
  51.  
  52.      OO using Abstract Objects and Polymorphism.
  53.  
  54. _
  55. You've got a fiend in Pennsylvania.
  56.  
  57. +------------------------------------------------------------+
  58. |* Chad Z. Hower  -  phoenix@pobox.com                       |
  59. |* Consultant - Phoenix Business Enterprises                 |
  60. |         pbe@pobox.com   -   http://pobox.com/~pbe          |
  61. |* Principal Analyst Programmer -                            |
  62. |         SCB Computer Technology Inc - czhower@eastman.com  |
  63. |Physically in Church Hill, TN - Logically Not Sure          |
  64. |     **** My Opinions are my own, I don't steal them ****   |
  65. +------------------------------------------------------------+
  66. >>SQUID - The ultimate database reader, and NO limits. #$737961
  67. **Special Compile: 1.033B (Beta)
  68.